# 列表真正意义的复制
# 1.假复制 用 = 进行赋值 错误的
# 复制列表操作
# names = ["Mike","Mary","Jan","Jack"]
# names_源文件 = names
# name.append ("Zhicao")
# print("names_ = ",names)
# print("names_源文件 = ",names_源文件)

#正确的方法 1. copy

names = ["Mike","Mary","Jan","Jack"]
names_源文件 = names
name.append ("Zhicao")
print("names_ = ",names)
print("names_源文件 = ",names_源文件)

#正确的方法 2.切片
names = ["Mike","Mary","Jan","Jack"]
names_源文件 = names[:]
name.append ("Zhicao")
print("names_ = ",names)
print("names_源文件 = ",names_源文件)


